package com.gitee.zhanyao.security.jwt;

import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.oauth2.provider.token.DefaultAccessTokenConverter;
import org.springframework.security.oauth2.provider.token.DefaultUserAuthenticationConverter;

/**
 * @author zhanyao
 */
public class OauthAccessTokenConverter extends DefaultAccessTokenConverter {

    public OauthAccessTokenConverter(UserDetailsService userService) {
        DefaultUserAuthenticationConverter converter = new DefaultUserAuthenticationConverter();
        converter.setUserDetailsService(userService);
        super.setUserTokenConverter(converter);
    }

}